package client;

import java.awt.Button;
import java.awt.event.*;
/**
 * 
 * @author Jesse Gorter
 *
 */
public class MyButton extends Button implements ActionListener
{
	
	MyApplet p;
	public MyButton(String a, MyApplet applet)
	{
		super(a);
		p = applet;
		this.addActionListener(this);
	}
	public void actionPerformed(ActionEvent e)
	{	System.out.println(this.getActionCommand());
		if(this.getActionCommand().equals("exit"))
		{	
			p.destroy();
			System.exit(0);
		}
		
		if(this.getActionCommand().equals("login"))
		{
			p.logc.login();
		}
		
		if(this.getActionCommand().equals("Update"))
		{
			p.listc.update();
		}
		if(this.getActionCommand().equals("Delete"))
		{
			p.listc.delete();
		}
		if(this.getActionCommand().equals("Insert"))
		{
			p.listc.insert();
		}
	}
	
}
